<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2021/12/15
  Time: 10:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%String path = request.getContextPath()+"/";%>
<html>
<head>
    <base href="<%=path%>">
    <title>Title</title>
    <link href="static/css/bootstrap.min.css?v=3.3.7" rel="stylesheet" />
    <link href="https://unpkg.com/bootstrap-table@1.19.1/dist/bootstrap-table.min.css" rel="stylesheet">
    <link href="static/js/plugins/ztree/css/zTreeStyle/zTreeStyle.css" rel="stylesheet" />

</head>
<style>
    #query ul li{
        display: inline-block;
        list-style: none;
        float:left;
        width:300px;
        margin-top:5px;
    }
    #query ul li input,select{
        width:200px;
        display:inline-block;
    }
</style>
<body style="background-color: gainsboro;overflow-x: hidden;">
<ul id="tree" class="ztree"></ul>
</body>
<script src="static/js/jquery.min.js?v=2.1.4"></script>
<script src="static/js/bootstrap.min.js?v=3.3.7"></script>
<script src="https://unpkg.com/bootstrap-table@1.19.1/dist/bootstrap-table.min.js"></script>
<script src="https://unpkg.com/bootstrap-table@1.15.3/dist/locale/bootstrap-table-zh-CN.min.js"></script>
<script src="static/js/plugins/layer/layer.min.js"></script>
<script src="static/js/plugins/ztree/js/jquery.ztree.core.js"></script>
<script src="static/js/plugins/ztree/js/jquery.ztree.excheck.js"></script>

<script src="static/sofwin.js"></script>

<script>
    var zTreeObj;
    // zTree 的参数配置，深入使用请参考 API 文档（setting 配置详解）
    var setting = {
        callback:{
        onClick:function(event ,treeId,treeNode,clickFlag){
           let parentId = treeNode.id;
           let parentName = treeNode.menuName;
           window.parent.changeParent(parentId,parentName);
           window.parent.close();
        }
    },
        data:{
            simpleData:{
                enable:true,
                pIdKey:'parentId'
            },
            key:{
                name:'menuName'
            }
        }
    };
    // zTree 的数据属性，深入使用请参考 API 文档（zTreeNode 节点数据详解）
    var zNodes;
    $(document).ready(function(){
        $.operator.get('menu/treeData?roleId=${roleId}','',function(ret){
            zNodes = ret.result;
            zTreeObj = $.fn.zTree.init($("#tree"), setting, zNodes);
            zTreeObj.expandAll(true);
        })
    });

</script>

</html>
